/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.gatech.ealf.keyboardassistanceplaf;

import edu.gatech.ealf.AuxiliaryLookAndFeel;
import edu.gatech.ealf.AuxiliaryUIDefaults;
import javax.swing.UIDefaults;

/**
 *
 * @author Hemanth Pai
 */
public class KeyboardAssistanceLookAndFeel extends AuxiliaryLookAndFeel {
    
    
    private static KeyboardAssistanceLookAndFeel instance = null;
    
    private float zoomFactor = 2;
    
    private boolean displayEnabled = true;
    
    private boolean speechEnabled = true;
    
    private int characterDisplayTime = 5000;
    
    
    public static KeyboardAssistanceLookAndFeel getInstance(){
    	if(instance == null){
    		instance = new KeyboardAssistanceLookAndFeel();
    	}
    	return instance;
    }
    
    private KeyboardAssistanceLookAndFeel(){
        uidefaults = new AuxiliaryUIDefaults();
        Object[] uiDefaults = {
            "TextFieldUI", "edu.gatech.ealf.keyboardassistanceplaf.KATextBoxUI",
            "TextAreaUI", "edu.gatech.ealf.keyboardassistanceplaf.KATextBoxUI",
            "TextPaneUI", "edu.gatech.ealf.keyboardassistanceplaf.KATextBoxUI",
        };
        uidefaults.putDefaults(uiDefaults);
    }
    
    
    @Override
	public void finalize(){
        
    }
    
    @Override
    public String getName() {
        return "KeyboardAssistanceKeyboardLookAndFeel";
    }

    @Override
    public String getID() {
        return "KeyboardAssistanceKeyboardLookAndFeel";
    }

    @Override
    public String getDescription() {
        return "A Look and Feel that renders a key pressed as a Character on the screen";
    }

    @Override
    public boolean isNativeLookAndFeel() {
        return false;
    }

    @Override
    public boolean isSupportedLookAndFeel() {
        return true;
    }
    
    @Override
	public UIDefaults getDefaults() {
        return uidefaults;
    }

    public boolean isDisplayEnabled() {
        return displayEnabled;
    }

    public void setDisplayEnabled(boolean displayEnabled) {
        this.displayEnabled = displayEnabled;
    }

    public boolean isSpeechEnabled() {
        return speechEnabled;
    }

    public void setSpeechEnabled(boolean speechEnabled) {
        this.speechEnabled = speechEnabled;
    }

    public float getZoomFactor() {
        return zoomFactor;
    }

    public void setZoomFactor(float zoomFactor) {
        this.zoomFactor = zoomFactor;
    }

    public int getCharacterDisplayTime() {
        return characterDisplayTime;
    }

    public void setCharacterDisplayTime(int characterDisplayTime) {
        this.characterDisplayTime = characterDisplayTime;
    }
    
}
